<!DOCTYPE html>
<html style="background-color:#fff;height:100%">
<head>
    <meta charset="UTF-8">
    <title>科研项目表单页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css" />
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/it/common/css/style.css" />
    <style>
        .thesis {
            width: 100%;
            height: 100%;
            padding: 0px;
            padding-bottom: 120px;
            overflow-y: auto;
        }
        .thesis label {
            width: 30%!important;
        }
        .thesisbor>div {
            margin: 1% !important;
            padding: 0px 4% !important;
            width: 90% !important;
        }
        .beizhu-div {
            width: 60% !important;
        }
        .beizhu-div textarea{
            width: 100%!important;
        }
        .upload-file-div {
            width: 70%!important;
            padding-left: 2%
        }
        .upload-file-li {
            width: 90% !important;
        }
        .zb-input {
            width: 140px!important;
            padding: 0px 10px!important;
        }
        .iTtable{
            border: 0px;
        }
        .thesis input {
            width: 160px!important;
            padding: 0px 0px 0px 10px!important;
        }
        .layui-form-select input{
            width: 170px!important;
        }
        .h34 {
            height: 34px;
        }
        .file-name-span {
            margin-top: 8px!important;
        }
        .w50p {
            width: 50% !important;
        }
        .cursor{
            cursor: pointer!important;
        }
    </style>
</head>
<body>
<!--新建文件夹-->
<form class="layui-form">
<div class="layui-container" style="margin-top:40px;padding-bottom: 80px">
    <div class="thesis thesisPro whitebg">
        <div class="ft20 bold">科研项目信息</div>
        <ul class="clearfix">
            <li class="clearfix w50p h34">
                <label class="fl gary">获批时间</label>
                <div class="fl">
                    <input type="hidden" name="spfId" value="${formData.spfId}">
                    <input id="spfF4" name="spfF4" value="${formData.spfF4}" lay-maxlength="128" lay-verify="maxlength" type="text" placeholder="填写获批时间"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">项目级别</label>
                <div class="fl">
                    <select name="spfF2">
                        <#list xmjbList as xmjb>
                            <option value="${xmjb.badtCode}"<#if (xmjb.badtCode == formData.spfF2)> selected="selected" </#if>>${xmjb.badtName}</option>
                        </#list>
                    </select>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">计划类别</label>
                <div class="fl">
                    <select name="spfF3">
                        <#list jhlbList as jhlb>
                            <option value="${jhlb.badtCode}"<#if (jhlb.badtCode == formData.spfF3)> selected="selected" </#if>>${jhlb.badtName}</option>
                        </#list>
                    </select>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">项目名称<span style="color: red">*</span></label>
                <div class="fl">
                    <input type="text" name="spfF1" value="${formData.spfF1}" lay-maxlength="128" lay-verify="maxlength|required" placeholder="填写项目名称"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">项目编号</label>
                <div class="fl">
                    <input type="text" name="spfF5" value="${formData.spfF5}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写项目编号"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">资金(经费)金额(元)</label>
                <div class="fl">
                    <input type="text"  name="spfF6"  value="${formData.spfF6}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写资金(经费)金额(元)"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">计划（批准）下达单位</label>
                <div class="fl">
                    <input type="text" name="spfF7" value="${formData.spfF7}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写计划（批准）下达单位"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">批准文号</label>
                <div class="fl">
                    <input type="text" name="spfF8" value="${formData.spfF8}" lay-maxlength="128" lay-verify="maxlength" placeholder="填写批准文号"/>
                </div>
            </li>
            <li class="clearfix h34" style="width: 50%">
                <label class="fl gary">项目起止年月</label>
                <div class="fl" style="width: 65%!important;">
                    <input type="text" id="spfF9" name="spfF9" value="${formData.spfF9}" lay-maxlength="128" lay-verify="maxlength" style="width: 40%!important;"/>
                    <span>至</span>
                    <input type="text" id="spfF10" name="spfF10" value="${formData.spfF10}" lay-maxlength="128" lay-verify="maxlength"  style="width: 40%!important;"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">项目进度</label>
                <div class="fl">
                    <select name="spfF11">
                        <#list xmjdList as xmjd>
                            <option value="${xmjd.badtCode}"<#if (xmjd.badtCode == formData.spfF11)> selected="selected" </#if>>${xmjd.badtName}</option>
                        </#list>
                    </select>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">项目负责人<span style="color: red">*</span></label>
                <div class="fl">
                    <input type="text" name="spfF12" value="${formData.spfF12}" lay-maxlength="128" lay-verify="maxlength|required"  placeholder="填写项目负责人"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">申报项目团队总人数</label>
                <div class="fl">
                    <input type="text" name="spfF13" value="${formData.spfF13}" lay-maxlength="128" lay-verify="maxlength"  placeholder="填写申报项目团队总人数"/>
                </div>
            </li>
        </ul>
        <div>申报项目团队成员</div>
        <ul id="team1Ul">
            <li class="clearfix member w50p h34">
                <label class="fl gary">姓名1</label>
                <div class="fl">
                    <input type="text" name="formDataList[0].data1" lay-maxlength="128" lay-verify="maxlength" placeholder="填写姓名1"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">排名</label>
                <div class="fl">
                    <input type="text" name="formDataList[0].data2" lay-maxlength="128" lay-verify="maxlength" placeholder="填写排名"/>
                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1 cursor"  onclick="delTeam(this,'team1Ul','formDataList')">
                </div>
            </li>
            <li class="clearfix member w50p h34">
                <label class="fl gary">姓名2</label>
                <div class="fl">
                    <input type="text" name="formDataList[1].data1" lay-maxlength="128" lay-verify="maxlength" placeholder="填写姓名2"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">排名</label>
                <div class="fl">
                    <input type="text" name="formDataList[1].data2" lay-maxlength="128" lay-verify="maxlength" placeholder="填写排名"/>
                    <img src="/plugin/common/images/77@2x.png" class="thesisimg2 cursor" onclick="addTeam(this,'team1Ul',undefined,'formDataList')">
                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1 cursor" onclick="delTeam(this,'team1Ul','formDataList')">
                </div>
            </li>
            <li class="clearfix h34" style="width: 100%!important;">
                <label class="fl gary" style="width: 15%!important;">项目实施团队总人数</label>
                <div class="fl">
                    <input type="text" name="spfF14" value="${formData.spfF14}" lay-maxlength="128" lay-verify="maxlength"  placeholder="填写项目实施团队总人数"/>
                </div>
            </li>
        </ul>
        <div>项目实施团队成员</div>
        <ul id="team2Ul">
            <li class="clearfix member w50p h34">
                <label class="fl gary">姓名1</label>
                <div class="fl">
                    <input type="text" name="formDataList2[0].data1" lay-maxlength="128" lay-verify="maxlength" placeholder="填写姓名1"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">排名</label>
                <div class="fl">
                    <input type="text" name="formDataList2[0].data2" lay-maxlength="128" lay-verify="maxlength" placeholder="填写排名"/>
                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1 cursor" onclick="delTeam(this,'team2Ul','formDataList2')">
                </div>
            </li>
            <li class="clearfix member w50p h34">
                <label class="fl gary">姓名2</label>
                <div class="fl">
                    <input type="text" name="formDataList2[1].data1" lay-maxlength="128" lay-verify="maxlength" placeholder="填写姓名2"/>
                </div>
            </li>
            <li class="clearfix w50p h34">
                <label class="fl gary">排名</label>
                <div class="fl">
                    <input type="text" name="formDataList2[1].data2" lay-maxlength="128" lay-verify="maxlength" placeholder="填写排名"/>
                    <img src="/plugin/common/images/77@2x.png" class="thesisimg2 cursor" onclick="addTeam(this,'team2Ul',undefined,'formDataList2')">
                    <img src="/plugin/common/images/76@2x.png" class="thesisimg1 cursor" onclick="delTeam(this,'team2Ul','formDataList2')">
                </div>
            </li>
            <li></li>
        </ul>
        <ul class="writingul1">
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">项目申请书<span style="color: red">*</span></label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070001" lay-filter="file1100070001" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070001'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">项目协议书word或盖章扫描件pdf</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070002" lay-filter="file1100070002" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070002'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">项目官方立项通知</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070003" lay-filter="file1100070003" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070003'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">项目任务书word或盖章扫描件pdf</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070004" lay-filter="file1100070004" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070004'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">项目内部立项文件</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070005" lay-filter="file1100070005" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070005'}">
                        <span class="blue">上传pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">中期检查文件</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070006" lay-filter="file1100070006" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070006'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">结项验收文件</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070007" lay-filter="file1100070007" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070007'}">
                        <span class="blue">上传word或pdf</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix upload-file-li">
                <label class="fl gary" style="width: 15%!important;">其他</label>
                <div class="fl upload-file-div">
                    <div>
                        <img  id="file1100070008" lay-filter="file1100070008" src="/plugin/common/images/57@2x.png" class=" thesisimg3 file-upload" filedata="{'type':'1100070008'}">
                        <span class="blue">上传word，pdf或图片</span>
                    </div>
                    <div class="thesisbor" style="width: 100%!important;">

                    </div>
                </div>
            </li>
            <li class="clearfix">
                <label class="fl gary" style="width: 17%!important;">备注</label>
                <div class="fl beizhu-div">
                    <textarea name="spfF15" lay-maxlength="200" lay-verify="maxlength"  placeholder="填写备注">${formData.spfF15}</textarea>
                </div>
            </li>
        </ul>
    </div>
</div>
<div class="layui-footer" style="width: 100%;text-align: center;background-color: #fff;position:fixed;bottom:0px;height: 50px;padding-top: 15px">
    <input class="layui-btn layui-btn-primary layui-btn-sm" type="button" value="关闭" onclick="_itkl.content.layerClose()">
    <input id="sub-btn" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit lay-filter="formDemo" type="button" value="确定" >
</div>
</form>
<!--JQ-->
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/jquery-1.8.3.min.js"></script>
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/comment.js"></script>
<!--选择城市js-->
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/it/common/js/itkl.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/common/js/form.file.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/html" id="zlDemo">
    <img src="/plugin/common/images/77@2x.png" tableind="{{d.LAY_TABLE_INDEX}}" sucid="{{d.sucId}}"
         class="cursor" alt="" class="delete" lay-event="del" tableid="zztable" delurl="/sys/personCenter/delCert" <#if (shenhe != '1')>onclick="delZz(this)"</#if>>
</script>
<script>
    var dicId='${dicId}';
    var formCode='${formCode}';
    var laydate;
    var temp = '${temp}';
    var fileCount = '${fileCount}';
    var edit = '${edit}';
    var deledFileIds = [];
    layui.use(['form', 'layer', 'upload', 'element', 'table'], function () {
        var form = layui.form, layer = layui.layer,table = layui.table; laydate = layui.laydate;
        laydate.render({//获批时间
            elem: '#spfF4',
            trigger: 'click'
        })
        laydate.render({//项目开始年月
            elem: '#spfF9',
            trigger: 'click'
        })
        laydate.render({//项目结束年月
            elem: '#spfF10',
            trigger: 'click'
        })
        form.verify({
            maxlength: function (v,item) {
                var maxlength = item.getAttribute('lay-maxlength');
                if(v.trim()!=''){
                    if(v.trim().length>maxlength){
                        return "输入长度不能大于"+maxlength+"个字符！";
                    }
                }
            },
            number: function (v) {
                var reg = /^[0-9]*$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的数字';
                }
            },
            decimal: function (v) {
                var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,10})?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的金额';
                }
            },
            perdecimal: function (v) {
                var reg = /^[1-9][0-9]*([.][0-9]+)?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    if(v.trim()!="0"  || v.trim()!=0){
                        return '请输入数字';
                    }
                }
            }
        })


        //提交
        form.on('submit(formDemo)', function (data) {
            $('#sub-btn').attr('disabled','disabled');
            data.field.spfF29 = dicId;
            data.field.spfF30 = formCode;
            if(deledFileIds && deledFileIds.length>0){
                for(var a=0;a<deledFileIds.length;a++){
                    data.field['strList9[' + a + ']'] = deledFileIds[a];
                }
            }
            var json=data.field;
            var wj=$(".1100070001-input").val();
            if(!wj){
                layer.msg("项目申请书没上传",{icon:2});
                $('#sub-btn').removeAttr('disabled');
                return false;
            }
            if(json){
                layerAjax("/it/form/insertBook",json,'',function (d) {
                    if(d){
                        layer.msg(d.msg,{icon:1})
                        setTimeout(function(){
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        },1000);
                    }else{
                        $('#sub-btn').removeAttr('disabled');
                        layer.msg(d.msg,{icon:2})
                    }
                })
            }
        })
    })

    function addTeam(e,id,data,listname){
        var member_count = $('#'+id).find('.member').length;
        //添加申报项目团队成员
        //在ul的最后新增一个li
        var _add_img = $(e);
        var name = '';
        var ord = '';
        if(data && data.data1){
            name = data.data1;
        }
        if(data && data.data2){
            ord = data.data2;
        }
        //移动加号图片:
        $('#'+id).find('li:last').before('<li class="clearfix member w50p">'
            +'<label class="fl gary">姓名<span class="ind">'+(member_count+1)+'</span><span style="color: red">*</span></label>'
            +'<div class="fl">'
            +'<input type="text" name="'+listname+'['+member_count+'].data1" value="'+name+'" lay-maxlength="128" lay-verify="maxlength|required" placeholder="填写姓名'+(member_count+1)+'"/>'
            +'</div>'
            +'</li>'
            +'<li class="clearfix w50p">'
            +'<label class="fl gary">排名<span style="color: red">*</span></label>'
            +'<div class="fl">'
            +'<input type="text" name="'+listname+'['+member_count+'].data2" value="'+ord+'" lay-maxlength="128" lay-verify="maxlength|required" placeholder="填写排名"/>'
            +'<img src="/plugin/common/images/77@2x.png" class="thesisimg2 cursor" onclick="addTeam(this,\''+id+'\',undefined,\''+listname+'\')">'
            +'<img src="/plugin/common/images/76@2x.png" class="thesisimg1 cursor" onclick="delTeam(this,\''+id+'\',\''+listname+'\')">'
            +'</div>'
            +'</li>');
        _add_img.remove();
    }

    function delTeam(e,id,listname){
        if($(e).prev().is('img')){
            parent.layer.msg('最后一行不允许删除',{icon:2});
            return ;
        }
        var theLi = $(e).parent().parent();
        theLi.prev().remove();
        theLi.remove();
        flushTeam(id,listname);
    }

    function flushTeam(id,listname){
        var team1Members = $('#'+id).find('.member');
        if(team1Members && team1Members.length>0){
            $.each(team1Members,function(i,e){
                $(e).find('input').attr('name',listname+'['+i+'].data1')
                $(e).find('.ind').text(i+1)
                $(e).find('input').attr('placeholder','请填写姓名'+(i+1));
                $(e).next().find('input').attr('name',listname+'['+i+'].data2');
            })
        }
    }

$(function(){

    $('input').attr('autocomplete','off');
    laydate.render({
        elem: '#casetimeinput1',
        trigger: 'click'
    })
    var tempFileIds = [];
    var uploadFileAdds = $('.file-upload');
    if(uploadFileAdds && uploadFileAdds.length>0){
        bindOneUploader(uploadFileAdds,0);
    }
    if(edit && edit == '1'){
        initFileShow();
    }
    var team1listStr = '${team1list}';
    var team1list = eval(team1listStr);
    if(team1list && team1list.length>0){
        for(var a=0;a<team1list.length;a++){
            var theData1 = '';
            if(team1list[a] && team1list[a].data1){
                theData1 = team1list[a].data1;
            }
            var theData2 = '';
            if(team1list[a] && team1list[a].data2){
                theData2 = team1list[a].data2;
            }
            if(a < 2){
                $('#team1Ul').find('input[name="formDataList['+a+'].data1"]').val(theData1);
                $('#team1Ul').find('input[name="formDataList['+a+'].data2"]').val(theData2);
            }else{
                var theAddImg = $('#team1Ul').find('.thesisimg2');
                addTeam(theAddImg,'team1Ul',team1list[a],'formDataList');
            }
        }
    }


    var team2listStr = '${team2list}';
    var team2list = eval(team2listStr);
    if(team2list && team2list.length>0){
        for(var a=0;a<team2list.length;a++){
            var theData1 = '';
            if(team2list[a] && team2list[a].data1){
                theData1 = team2list[a].data1;
            }
            var theData2 = '';
            if(team2list[a] && team2list[a].data2){
                theData2 = team2list[a].data2;
            }
            if(a < 2){
                $('#team2Ul').find('input[name="formDataList2['+a+'].data1"]').val(theData1);
                $('#team2Ul').find('input[name="formDataList2['+a+'].data2"]').val(theData2);
            }else{
                var theAddImg = $('#team2Ul').find('.thesisimg2');
                addTeam(theAddImg,'team2Ul',team2list[a],'formDataList2');
            }
        }
    }
})

    //显示上传的文件:
    function initFileShow(){
        var uploadFileAdds = $('.file-upload');
        initOneFileShow(uploadFileAdds,0);
    }

    function initOneFileShow(uploadFileAdds,i){
        var aFileUploadAdd = $(uploadFileAdds[i]);
        var fileDataStr = aFileUploadAdd.attr('filedata');
        var fileData = eval('(' + fileDataStr + ')');
        var fileContainer = aFileUploadAdd.parent().next();
        var type = fileData.type;
        layerAjaxGetIT('/it/form/getFileList',{ dicId: dicId, formFileType: type },'',uploadFileAdds,i,function (res) {
            if(res.flag){
                //显示:
                showFile(res.data,fileContainer,0);
            }
        })
    }

    function showFile(filelist,container,ind){
        if(filelist && filelist.length>0 && (ind < filelist.length)){
            var aFile = filelist[ind];
            var newFileId = aFile.id;
            var newIndex = $('.form-file-div-'+aFile.type).length*1;
            var fileName = '';
            if(aFile.type == '1100070001'){
                fileName = 'strList2';
            }else if(aFile.type == '1100070002'){
                fileName = 'strList3';
            }else if(aFile.type == '1100070003'){
                fileName = 'strList4';
            }else if(aFile.type == '1100070004'){
                fileName = 'strList5';
            }else if(aFile.type == '1100070005'){
                fileName = 'strList6';
            }else if(aFile.type == '1100070006'){
                fileName = 'strList7';
            }else if(aFile.type == '1100070007'){
                fileName = 'strList8';
            }else if(aFile.type == '1100070008'){
                fileName = 'strList9';
            }
            container.prepend('<div class="clearfix form-file-div form-file-div-'+aFile.type+'">\n' +
                '                            <span class="fl file-name-span">'+aFile.fileName+'</span>\n' +
                '                            <img src="/plugin/common/images/89@2x.png" class="fr cursor" onclick="_form_file.del.delReal(this,'+'&apos;'+aFile.id+'&apos;'+','+'&apos;'+aFile.type+'&apos;'+',deledFileIds)">\n' +
                '                            <input type="hidden" class="'+aFile.type+'-input" name="'+fileName+'['+newIndex+']" value="'+newFileId+'" />'+
                '                        </div>');
            ind ++;
            showFile(filelist,container,ind);
        }
    }

    //绑定上传组件单个
    function bindOneUploader(uploadFileAdds,i){
        var aFileUploadAdd = $(uploadFileAdds[i]);
        var id=aFileUploadAdd.attr('id');
        var fileDataStr = aFileUploadAdd.attr('filedata');
        var fileData = eval('(' + fileDataStr + ')');
        if(edit && edit == '1'){
            fileData['linkId'] = '${formCenterFileId}';
        }
        var fileContainer = aFileUploadAdd.parent().next();
        var type = fileData.type;
        var ext = '';
        var fileName = '';
        if(type == '1100070001'){
            ext = 'doc|docx|pdf';
            fileName = 'strList2';
        }else if(type == '1100070002'){
            ext = 'doc|docx|pdf';
            fileName = 'strList3';
        }else if(type == '1100070003'){
            ext = 'doc|docx|pdf';
            fileName = 'strList4';
        }else if(type == '1100070004'){
            ext = 'doc|docx|pdf';
            fileName = 'strList5';
        }else if(type == '1100070005'){
            ext = 'pdf';
            fileName = 'strList6';
        }else if(type == '1100070006'){
            ext = 'doc|docx|pdf';
            fileName = 'strList7';
        }else if(type == '1100070007'){
            ext = 'doc|docx|pdf';
            fileName = 'strList8';
        }else if(type == '1100070008'){
            ext = 'doc|docx|pdf|png|jpeg|gif|bmp|jpg';
            fileName = 'strList9';
        }
        //上传组件参数自定义:
        var uploadPara = {
            elem: '#'+id,
            accept: 'file',
            temp: temp,
            exts: ext,
            before: function(res){
                this.data = fileData;
            },
            container: fileContainer,
            fileName: fileName,
            // fileOrder: 'desc'
        };
        _form_file.upload.bind(uploadPara);
        if(i < uploadFileAdds.length-1){
            i++;
            bindOneUploader(uploadFileAdds,i);
        }
    }
</script>

</body>

</html>